package com.hama.iotrust.common.log.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;


@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface BusinessLog {

    /**
     * 日志描述.
     */
    String info();

    LogLevel level();

    /**
     * 日志类型
     */
    LogType type() default LogType.GENERAL;

    /**
     * 业务类型
     */
    BusinessType businessType() default BusinessType.UNKNOW;

    /**
     * 日志级别.
     * 
     * @author 金建强(ptma@163.com)
     * @version 1.0.0
     * @since 2013-4-8 14:30:10
     */
    public enum LogLevel {

        LOW(0), NORMAL(1), HIGH(2), IMPORTANT(3);

        private int logLevel;

        LogLevel(int logLevel){
            this.logLevel = logLevel;
        }

        public int getLogLevel() {
            return logLevel;
        }
    }

    /**
     * 日志类型.
     * 
     * @author 金建强(ptma@163.com)
     * @version 1.0.0
     * @since 2013-4-8 14:30:23
     */
    public enum LogType {

        GENERAL(0), BUSINESS(1);

        private int logType;

        LogType(int logType){
            this.logType = logType;
        }

        public int getLogType() {
            return logType;
        }

    }

    /**
     * 业务类型.
     * 
     * @author 金建强(ptma@163.com)
     * @version 1.0.0
     * @since 2013-4-8 14:30:33
     */
    public enum BusinessType {

        UNKNOW(0), ADD(1), UPDATE(2), DELETE(3), SELECT(4), OTHER(5);

        private int businessType;

        BusinessType(int businessType){
            this.businessType = businessType;
        }

        public int getBusinessType() {
            return businessType;
        }

    }
}
